#pragma once
#include <vector>
#include "MTVector.h"

namespace matsu
{
	template <typename T>
	class Matrix2 {
	public:
		Matrix2();
		Matrix2(const T* m);
		vec2 x;
		vec2 y;
	};

	template <typename T>
	class Matrix3 {
	public:
		Matrix3();
		Matrix3(const T* m);
		Matrix3 transposed() const;
		const T* pointer() const;

		vec3 x;
		vec3 y;
		vec3 z;
	};

	template <typename T>
	class Matrix4 {
	public:
		Matrix4();
		Matrix4(const Matrix3<T>& m);
		Matrix4(const T* m);
		Matrix4 operator * (const Matrix4& b) const;
		Matrix4& operator *= (const Matrix4& b);
		Vector4<T> operator *(const Vector4<T> &b) const;
		Vector4<T> multi(const Vector4<T> &b) const;
		Matrix4 transposed() const;
		Matrix3<T> toMat3() const;
		const T* pointer() const;

		static Matrix4 identity();

		vec4 x;
		vec4 y;
		vec4 z;
		vec4 w;
	};

	typedef Matrix2<float> mat2;
	typedef Matrix3<float> mat3;
	typedef Matrix4<float> mat4;
}

#include "MTMatrix.hpp"
